package com.ruoyi.recycle.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.recycle.domain.IntegralConfig;
import com.ruoyi.recycle.mapper.IntegralConfigMapper;
import com.ruoyi.recycle.service.IIntegralConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 积分规则设置Service业务层处理
 *
 * @author Wubk
 * @date 2022-05-22
 */
@Service
public class IntegralConfigServiceImpl extends ServiceImpl<IntegralConfigMapper, IntegralConfig> implements IIntegralConfigService {
    @Autowired
    private IntegralConfigMapper integralConfigMapper;

    /**
     * 查询积分规则设置
     *
     * @param id 积分规则设置主键
     * @return 积分规则设置
     */
    @Override
    public IntegralConfig selectIntegralConfigById(Long id) {
        return integralConfigMapper.selectIntegralConfigById(id);
    }

    /**
     * 查询积分规则设置列表
     *
     * @param integralConfig 积分规则设置
     * @return 积分规则设置
     */
    @Override
    public List<IntegralConfig> selectIntegralConfigList(IntegralConfig integralConfig) {
        return integralConfigMapper.selectIntegralConfigList(integralConfig);
    }

    /**
     * 新增积分规则设置
     *
     * @param integralConfig 积分规则设置
     * @return 结果
     */
    @Override
    public int insertIntegralConfig(IntegralConfig integralConfig) {
        return integralConfigMapper.insertIntegralConfig(integralConfig);
    }

    /**
     * 修改积分规则设置
     *
     * @param integralConfig 积分规则设置
     * @return 结果
     */
    @Override
    public int updateIntegralConfig(IntegralConfig integralConfig) {
        return integralConfigMapper.updateIntegralConfig(integralConfig);
    }

    /**
     * 批量删除积分规则设置
     *
     * @param ids 需要删除的积分规则设置主键
     * @return 结果
     */
    @Override
    public int deleteIntegralConfigByIds(Long[] ids) {
        return integralConfigMapper.deleteIntegralConfigByIds(ids);
    }

    /**
     * 删除积分规则设置信息
     *
     * @param id 积分规则设置主键
     * @return 结果
     */
    @Override
    public int deleteIntegralConfigById(Long id) {
        return integralConfigMapper.deleteIntegralConfigById(id);
    }
}
